/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package baitap;

import java.util.Scanner;

/**
 *
 * @author Nhim
 */
public class Bai6 {
    public static void main(String[] args) {
        int i = 100000;
        while(i <= 999999){
            if(Thuannghich(i) == true) System.out.println(i);
            i++;
        }
    }
    
    public static boolean Thuannghich(long n){
        long m, dao = 0;
        m = n;
        while(n > 0){
            dao = dao * 10 + n % 10;
            n /= 10;
        }
        if(dao == m) return true;
        return false;
    }
}
